package excel;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;

import java.util.Map;

/**
 * Excel监听器
 *
 * @author: xingfuhao
 * @create: 2022-01-26 16:41
 */
public class ExcelListener  extends AnalysisEventListener<DemoData> {

    @Override
    public void invoke(DemoData data, AnalysisContext analysisContext) {
        //一行一行读取Excel内容
        System.out.println("***"+data);
    }

    @Override
    public void invokeHeadMap(Map<Integer, String> headMap, AnalysisContext context) {
        System.out.println("表头"+headMap);
    }

    //读取表头内容
    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {
    }
}
